/**
 * 上海中赢金融信息服务有限公司
 * Copyright (c) 2017-2027 Chinazyjr,Inc.All Rights Reserved.
 */

package com.sys.midware.hbase.model;

/**
 * <b>ClassName:</b> HbaseColumn.java <br/>
 * <b>Description:</b> TODO <br/>
 * <b>Date:</b>     2015年10月26日 下午5:26:53<br/> 
 * @author   mobing
 * @version  	 
 */
public class HbaseColumn {
    private String columnFamily = null;// 列族

    private String column = null;// 列

    private String value = null;// 列值

    private long timestamp = 0;

    public HbaseColumn(String columnFamily, String column, String value, long timestamp) {
        super();
        this.columnFamily = columnFamily;
        this.column = column;
        this.value = value;
        this.timestamp = timestamp;
    }

    public HbaseColumn(String columnFamily, String column, String value) {
        this(columnFamily, column, value, 0);
    }

    public String getColumnFamily() {
        return columnFamily;
    }

    public String getColumn() {
        return column;
    }

    public String getValue() {
        return value;
    }

    public long getTimestamp() {
        return timestamp;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((column == null) ? 0 : column.hashCode());
        result = prime * result + ((columnFamily == null) ? 0 : columnFamily.hashCode());
        result = prime * result + (int) (timestamp ^ (timestamp >>> 32));
        result = prime * result + ((value == null) ? 0 : value.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        HbaseColumn other = (HbaseColumn) obj;
        if (column == null) {
            if (other.column != null)
                return false;
        } else if (!column.equals(other.column))
            return false;
        if (columnFamily == null) {
            if (other.columnFamily != null)
                return false;
        } else if (!columnFamily.equals(other.columnFamily))
            return false;
        if (timestamp != other.timestamp)
            return false;
        if (value == null) {
            if (other.value != null)
                return false;
        } else if (!value.equals(other.value))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "HbaseColumn [columnFamily=" + columnFamily + ", column=" + column + ", value=" + value
                + ", timestamp=" + timestamp + "]";
    }
}

